//
//  UIImageViewOC.m
//  Study-code
//
//  Created by quanhao huang on 2021/11/17.
//

#import "UIImageViewOC.h"
/**
 我们都知道view是视图，那image view是什么呢？如其名，它是一个带图片的view，主要用于放置图片显示
 */
@implementation UIImageViewOC

- (void)createUI {
    //新建一个image view
    //一共两种创建方式，可以体验一下两种创建方式的区别
    //(1)
    UIImageView *imgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
    //设置图片
    imgView1.image = [UIImage imageNamed:@"图片"];
    //(2)
    UIImageView *imgView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"图片"]];
    imgView2.frame = CGRectMake(0, 0, 100, 100);
    //当然我还能这样
    UIImageView *imgView3 = [[UIImageView alloc] init];
    imgView3.image = [UIImage imageNamed:@"图片"];
    imgView3.frame = CGRectMake(0, 0, 100, 100);
}

@end
